const Redis = require("ioredis");
const redis = new Redis(6379, "127.0.0.1");
// const result3 = redis.eval(`return redis.call('ZRANGEBYSCORE',  '-inf', '+inf', 'WITHSCORES', 'LIMIT', 0, 1,KEYS[1])`,1,['task:pool'])
const result3 = redis.eval(`return redis.call('ZRANGEBYSCORE',  KEYS[1], ARGV[1],ARGV[2], ARGV[3], ARGV[4], ARGV[5], ARGV[6])`,1,'task:pool1','-inf', '+inf', 'WITHSCORES', 'LIMIT', 0, 1)
// const aaa = "return redis.call('ZRANGEBYSCORE',KEYS[1],ARGV[1],ARGV[2],'LIMIT',ARGV[3],ARGV[4])"
// const result3 = redis.eval(aaa,2,'foo','bar',0,'+inf',123,456)

async function eval() {
    let str = await result3;
    console.log(str)
    // await redis.evalTest('testKey1', 'testKey2', 'val1', 'val2');
   /*  const result = await redis.get('testKey1');
    const result2 = await redis.get('testKey2');
    console.log(result, result2); */
}
eval()

//提取数据原子性操作，修改也是原子性操作